﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/admin/TempAdmin.master" CodeFile="CategoryManage.aspx.cs" Inherits="CategoryManage" %>
<asp:Content ID="categoryContent" ContentPlaceHolderID="ContentRight" runat="server">
   <form id="categoryform" runat="server">
        <table>
            <tr>
                <img src="../img/pixel_trans.gif" height="10px" />
            </tr>
             <tr>
                <td align="center">
                    <asp:Label ID="lblHeader" runat="server" Font-Size="Large" Font-Bold="true" ForeColor="#003300"> Danh sách chủng loại</asp:Label>
                </td>
             </tr>
             <tr>
                <td>
                    <img src="../img/pixel_trans.gif" height="10px" />
                </td>
             </tr>
             <tr>
                <td colspan="2" align="center">
                    <asp:Label ID="lblTextMessage" runat="server" ForeColor="#003300"></asp:Label>
                </td>
             </tr>
             <tr>
                <td>
                    <img src="../img/pixel_trans.gif" height="10px" />
                </td>
             </tr>
             <tr>
                <td>
                    <asp:GridView ID="gvCategory" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="CategoryID" ForeColor="#003300" DataSourceID="odsCategory" 
                        onrowdeleting="gvCategory_RowDeleting" 
                        onselectedindexchanged="gvCategory_SelectedIndexChanged">
                        <Columns>
                            <asp:BoundField HeaderStyle-HorizontalAlign="Center" DataField="CategoryID" HeaderText="Mã chủng loại" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID">
                                <ItemStyle HorizontalAlign="Center" ForeColor="Black" />
                            </asp:BoundField>
                            <asp:BoundField HeaderStyle-HorizontalAlign="Center" DataField="CategoryName" HeaderText="Tên chủng loại" SortExpression="CategoryName">
                                <ItemStyle HorizontalAlign="Center" ForeColor="Black" />
                            </asp:BoundField>
                             <asp:TemplateField>
                                <ItemStyle HorizontalAlign ="Center" />
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbUpdate" runat="server" style="color:Blue; font-family: tahoma; text-decoration: none" CommandName="select">&nbsp;&nbsp;&nbsp;&nbsp;Chi 
                                    tiết [&gt;&gt;]</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemStyle HorizontalAlign ="Center" />
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbDelete" runat="server" style=" color:Blue; font-family:tahoma; text-decoration: none" OnClientClick='return confirm("Bạn có chắc chắn muốn xóa sản phẩm này không ?")' CommandName="delete">&nbsp;&nbsp;&nbsp;&nbsp;Xóa 
                                    [x]</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    
                    </asp:GridView>
                </td>
             </tr>
        </table>
    <asp:ObjectDataSource ID="odsCategory" runat="server" DeleteMethod="Delete" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllCategory" 
            TypeName="BonSaiTableAdapters.CategoriesTableAdapter">
        <DeleteParameters>
            <asp:Parameter Name="Original_CategoryID" Type="Int32" />
        </DeleteParameters>
        </asp:ObjectDataSource>
    </form>
</asp:Content>